import tables
from histogram import *
h = Histogram2D('win0', (64, 100), ((-0.5, 63.5), (0, 4095)), xlabel='Sample no', ylabel='ADC')
fp = tables.openFile("one-channel-peds-128.h5")
x = fp.root.data.read()

for win, samp, adc in x:
    if win == 0:        
        h.fill((samp, adc))
        
h.image(out=h.name)
hy = h.project_to_y(0, 1)

hy.image(out=hy.name)



